<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: bin.liu
  Date: 2018/12/20
  Time: 14:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="main-content">
    <div class="box box-main">
        <form id="facilityDataForm"
              method="post" enctype="multipart/form-data" class="form-horizontal">
            <div class="box-body">
                <input type="hidden" name="id" value="${facilityData.id}"/>
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-group">
                            <div class="col-sm-12">
                                <div style="width: 300px;">
                                    <label class="control-label col-sm-12" title="">
                                        <a href="${filePath}" id="filePath" class="showFileName" target="_blank">
                                        <span class="showFileName"></span>
                                        </a>
                                    </label>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<script>
    $(function () {
        if(${filePath == null || filePath == ''}){
            js.showMessage("未上传pdf文件！");
            closeView();
        }
        if (${fileName != null && fileName != ''}) {
            $(".showFileName").html('${fileName}');
            $("#delete1").show();
        }
        if (${filePath != null && filePath != ''}) {
            <%--window.location.href='${filePath}';--%>
            window.open('${filePath}', "_blank", "scrollbars=yes,resizable=1,modal=false,alwaysRaised=yes");
            closeView();
        }
    });
    function closeView() {
        layer.closeAll();
        // layer.close(LayWin['wFacilityData']);
    }
</script>
